import View, { Refs } from "./exampleUpload.view";
import UploadDialog from "./ExampleUploadDialog";
import ImagePreviewDialog from "./ExampleImagePreviewDialog";

@YvanUI.BizModule()
export default class Module extends View<Module, void> {
  onShow(): void {}

  click1() {
    const dialog = new UploadDialog();
    dialog.showDialog({
      success(cap) {
        console.log("上传成功回调：" + cap);
      }
    }, this)
  }

  click2() {
    const dialog = new ImagePreviewDialog();
    dialog.showDialog({
      imageUrl: 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1592559523251&di=403b9fdfca73879753cdfe7b90ebf2e4&imgtype=0&src=http%3A%2F%2Ft8.baidu.com%2Fit%2Fu%3D3571592872%2C3353494284%26fm%3D79%26app%3D86%26f%3DJPEG%3Fw%3D1200%26h%3D1290'
    }, this)
  }

  onFileUpload(sender: any, params: any) {
    debugger
  }
  onFileUploadError(sender: any, params: any) {
    debugger
  }
}
